'   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '           N a m e :   S t i t c h e r _ 0 . 2 . t x t                                                   D a t e :   0 5   A u g   2 0 2 1 
 
 '       A u t h o r :   L e o n a r d o   D E   P A L O   P h . D .   &   R o b e r t o   F a s c i a n i   M s . C . 
 
 '         S c o p e :   E a r l y   t e s t   o f   t h e   s t i t c h e r   u s i n g   H A L   o r   A r d u H A L 
 
 '   H a r d w a r e :   A r d u i n o   N A N O 
 
 '           n o t e : 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       S W I T C H   S E T T I N G   L E A D S H I N E   M A 8 6 0                                                       O R I G I N A L 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       1         2         3         4         5         6         7         8 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '                                             O N       O N       O N       O N           4 0 0 
 
 '                                           O F F       O N       O N       O N           8 0 0 
 
 '                                             O N     O F F       O N       O N         1 6 0 0                               < < < < < 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '                                   O N                                                 P o w e r   s a v i n g 
 
 '                                 O F F                                                 N o   p o w e r   s a v i n g         < < < < < 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     O N       O N       O N                                                           2 . 0 0   A 
 
 '   O F F       O N       O N                                                           2 . 5 7   A 
 
 '     O N     O F F       O N                                                           3 . 1 4   A 
 
 '   O F F     O F F       O N                                                           3 . 7 1   A 
 
 '     O N       O N     O F F                                                           4 . 2 8   A 
 
 '   O F F       O N     O F F                                                           4 . 8 6   A 
 
 '     O N     O F F     O F F                                                           5 . 4 3   A                           < < < < < 
 
 '   O F F     O F F     O F F                                                           6 . 0 0   A 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 O p t i o n   S p e e d   9 
 
 O p t i o n   G l o b a l K e y s   E n a b l e d 
 
 ' L o a d   " M e d i a \ I m a g e s \ x x x x x . j p g " 
 
 ' V a r s F r o m F i l e   " . \ T h e r e m i n o _ H A L \ T h e r e m i n o _ N o t e p a d \ C o n f i g V a r s . t x t " 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O A D   E X T E R N A L   P R O G R A M S 
 
 
 
 ' L o a d   T h e r e m i n o _ A r d u H A L \ T h e r e m i n o _ A r d u H A L . e x e 
 
 ' L o a d   T h e r e m i n o _ A r d u H A L \ T h e r e m i n o _ S l o t V i e w e r . e x e 
 
 ' L o a d   T h e r e m i n o _ A r d u H A L \ T h e r e m i n o _ S i g n a l S c o p e . e x e 
 
 ' L o a d   T h e r e m i n o _ A r d u H A L \ T h e r e m i n o _ D A A \ D A A . e x e 
 
 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e " 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r . e x e " 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ S i g n a l S c o p e . e x e " 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     V A R I A B L E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d R 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d G 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d B 
 
 V a r i a b l e   N u m e r i c   S l o t _ E n a b l e M o t o r s 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r X 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r Y 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   M o t o r s   l i m i t s 
 
 V a r i a b l e   N u m e r i c   X m a x                               =   3 2 0 
 
 V a r i a b l e   N u m e r i c   X m i n                               =       2 
 
 V a r i a b l e   N u m e r i c   Y m a x                               =   2 2 0 
 
 V a r i a b l e   N u m e r i c   Y m i n                               =       2 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   K e y   J o g   S p e e d 
 
 V a r i a b l e   N u m e r i c   K e y J o g _ S p e e d               =   1 0 0 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     T E S T   M A S T E R 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 F o r   v 1   =   1   T o   9 e 9 9 
 
 	 F o r   v 2   =   1   T o   2 0   '   < < <   t e s t i n g   f o r   2   s e c o n d s 
 
 	 	 I f   ( S l o t ( 0 )   > =   1   A n d   S l o t ( 0 )   < =   2 )   O r   K e y ( " C T R L " ) 
 
 	 	 	 E x i t   2 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 N e x t 
 
 	 P r i n t   "   I n v a l i d   m a s t e r   n u m b e r :   "   +   S l o t ( 0 )   +   C R L F 
 
 	 S l o t   0   =   R e c o g n i z e 
 
 	 B e e p 
 
 N e x t 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     I N I T I A L I Z A T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S e t   s l o t s 
 
 ' S l o t _ L e d R                     =   3 
 
 ' S l o t _ L e d G                     =   4 
 
 ' S l o t _ L e d B                     =   5 
 
 S l o t _ M o t o r X                   =   1 
 
 S l o t _ M o t o r Y                   =   3 
 
 S l o t _ E n a b l e M o t o r s       =   1 0 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S T A R T 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 G o s u b   E n a b l e M o t o r s 
 
 G o s u b   S e t B u t t o n s A n d K e y s 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   K E Y S 
 
 K e y   L e f t     G o s u b   E x e c K e y s 
 
 K e y   R i g h t   G o s u b   E x e c K e y s 
 
 K e y   U p         G o s u b   E x e c K e y s 
 
 K e y   D o w n     G o s u b   E x e c K e y s 
 
 K e y   S p a c e   G o s u b   E x e c K e y s 
 
 
 
 G o s u b   U p d a t e B u t t o n s 
 
 O p t i o n   G l o b a l K e y s   D i s a b l e d 
 
 
 
 S t o p 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     B U T T O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   S e t B u t t o n s A n d K e y s 
 
 	 B u t t o n   4   T e x t   E d i t S e q u e n c e 
 
 	 B u t t o n   E d i t S e q u e n c e   T e x t   " E d i t   s e q u e n c e " 
 
 	 B u t t o n   E d i t S e q u e n c e   C o l o r   P a l e G r e e n 
 
 	 
 
 	 B u t t o n   5   T e x t   R u n S e q u e n c e 
 
 	 B u t t o n   R u n S e q u e n c e   T e x t   " R U N   S E Q U E N C E " 
 
 	 B u t t o n   R u n S e q u e n c e   C o l o r   A q u a 
 
 	 
 
 	 B u t t o n   6   T e x t   S e l e c t S e q u e n c e 
 
 	 B u t t o n   S e l e c t S e q u e n c e   T e x t   " S e l e c t   S e q u e n c e " 
 
 	 B u t t o n   S e l e c t S e q u e n c e   C o l o r   P o w d e r B l u e 
 
 	 
 
 	 B u t t o n   8   T e x t   E n a b l e M o t o r s 
 
 	 B u t t o n   E n a b l e M o t o r s   C o l o r   T a n 
 
 	 
 
 	 B u t t o n   9   T e x t   D i s a b l e M o t o r s 
 
 	 B u t t o n   D i s a b l e M o t o r s   C o l o r   T a n 
 
 	 
 
 	 B u t t o n   1 1   T e x t   " R o t a t i o n " 
 
 	 B u t t o n   R o t a t i o n   C o l o r   Y e l l o w 
 
 	 B u t t o n   R o t a t i o n   T e x t   " R o t a t i o n " 
 
 	 
 
 	 B u t t o n   1 2   T e x t   " B t n C o o r d X " 
 
 	 B u t t o n   B t n C o o r d X   T e x t   " X   =   ? " 
 
 	 B u t t o n   B t n C o o r d X   C o l o r   Y e l l o w 
 
 	 
 
 	 B u t t o n   1 3   T e x t   " B t n C o o r d Y " 
 
 	 B u t t o n   B t n C o o r d Y   T e x t   " Y   =   ? " 
 
 	 B u t t o n   B t n C o o r d Y   C o l o r   Y e l l o w 
 
 	 
 
 	 B u t t o n   1 5   T e x t   C l o s e A l l 
 
 	 B u t t o n   C l o s e A l l   T e x t   " C L O S E   A L L " 
 
 	 B u t t o n   C l o s e A l l   C o l o r   R e d 
 
 	 
 
 	 B u t t o n   1 6   T e x t   E m e r g e n c y 
 
 	 B u t t o n   E m e r g e n c y   T e x t   " E M E R G E N C Y " 
 
 	 B u t t o n   E m e r g e n c y   C o l o r   R e d 
 
 ' 	 B u t t o n   E m e r g e n c y   S l o t     S l o t _ E m e r g e n c y 
 
 	 
 
 	 B u t t o n   1 7   T e x t   R e d O n 
 
 	 B u t t o n   R e d O n   C o l o r   R e d 
 
 	 
 
 	 B u t t o n   1 8   T e x t   M a g e n t a O n 
 
 	 B u t t o n   M a g e n t a O n   C o l o r   M a g e n t a 
 
 	 
 
 	 B u t t o n   1 9   T e x t   Y e l l o w O n 
 
 	 B u t t o n   Y e l l o w O n   C o l o r   Y e l l o w 
 
 	 
 
 	 B u t t o n   2 0   T e x t   G r e e n O n 
 
 	 B u t t o n   G r e e n O n   C o l o r   G r e e n 
 
 	 
 
 	 B u t t o n   2 1   T e x t   B l u e O n 
 
 	 B u t t o n   B l u e O n   C o l o r   M e d i u m B l u e 
 
 	 
 
 	 B u t t o n   2 2   T e x t   W h i t e O n 
 
 	 B u t t o n   G r e e n O n   C o l o r   G r e e n 
 
 	 
 
 	 B u t t o n   2 3   T e x t   R g b O f f 
 
 	 B u t t o n   R g b O f f   C o l o r   B l a c k 
 
 	 
 
 	 B u t t o n   2 5   T e x t   Z e r o _ D e g r e e 
 
 	 B u t t o n   Z e r o _ D e g r e e   T e x t   " Z e r o " 
 
 	 B u t t o n   Z e r o _ D e g r e e   C o l o r   L i g h t B l u e 
 
 	 
 
 	 B u t t o n   2 6   T e x t   9 0 _ D e g r e e 
 
 	 B u t t o n   9 0 _ D e g r e e   T e x t   " 9 0 " 
 
 	 B u t t o n   9 0 _ D e g r e e   C o l o r   L i g h t B l u e 
 
 	 
 
 	 B u t t o n   2 7   T e x t   1 8 0 _ D e g r e e 
 
 	 B u t t o n   1 8 0 _ D e g r e e   T e x t   " 1 8 0 " 
 
 	 B u t t o n   1 8 0 _ D e g r e e   C o l o r   L i g h t B l u e 
 
 	 
 
 	 B u t t o n   2 8   T e x t   2 7 0 _ D e g r e e 
 
 	 B u t t o n   2 7 0 _ D e g r e e   T e x t   " 2 7 0 " 
 
 	 B u t t o n   2 7 0 _ D e g r e e   C o l o r   L i g h t B l u e 
 
 	 
 
 	 B u t t o n   2 9   T e x t   3 6 0 _ D e g r e e 
 
 	 B u t t o n   3 6 0 _ D e g r e e   T e x t   " 3 6 0 " 
 
 	 B u t t o n   3 6 0 _ D e g r e e   C o l o r   L i g h t B l u e 
 
 R e t u r n 
 
 
 
 S t o p 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     E M E R G E N C Y 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E m e r g e n c y 
 
 ' 	 G o s u b   D i s a b l e A l l B u t t o n s 
 
 ' 	 B u t t o n   1 5   E n a b l e d 
 
 ' 	 B u t t o n   1 5   C o l o r   F l a s h i n g 7   Y e l l o w   R e d 
 
 ' 	 F o r   v 1   =   1   T o   9 e 9 9 
 
 ' 	 	 G o s u b   R e d O n 
 
 ' 	 	 W a i t   S e c o n d s   0 . 4 
 
 ' 	 	 G o s u b   R g b O f f 
 
 ' 	 	 W a i t   S e c o n d s   0 . 4 
 
 ' 	 	 L o a d   s o u n d \ A l a r m 1 0 b . w a v 
 
 ' 	 N e x t 
 
 S t o p 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     E N A B L E / D I S A B L E   B U T T O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E n a b l e A l l B u t t o n s 
 
 	 F o r   v 1   =   1   T o   3 2 
 
 	 	 B u t t o n   v 1   E n a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 L a b e l   D i s a b l e A l l B u t t o n s 
 
 	 F o r   v 1   =   1   T o   3 2 
 
 	 	 B u t t o n   v 1   D i s a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '   E N A B L E / D I S A B L E   M O T O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E n a b l e M o t o r s 
 
 	 S l o t ( S l o t _ E n a b l e M o t o r s )   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   D i s a b l e M o t o r s 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( S l o t _ E n a b l e M o t o r s )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     C L O S I N G   E V E N T S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   C l o s e A l l 
 
 	 ' G o s u b   S a v e V a r s A n d P o s i t i o n s 
 
 	 G o s u b   D i s a b l e M o t o r s 
 
 	 L o a d   C l o s e A p p s 
 
 R e t u r n 
 
 
 
 L a b e l   E v e n t S t o p 
 
 	 ' G o s u b   S a v e V a r s A n d P o s i t i o n s 
 
 	 G o s u b   E n a b l e A l l B u t t o n s 
 
 	 W i n d o w   S i z a b l e 
 
 	 G o s u b   D i s a b l e M o t o r s 
 
         ' S l o t ( S l o t _ S i g n a l S c o p e )   =   0 
 
 	 ' G o s u b   A i r O F F 
 
 	 ' G o s u b   W h i t e L i g h t O F F 
 
 E n d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     L E D   C O L O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R e d O n 
 
 	 S l o t   S l o t _ L e d R   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d G   =   0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   M a g e n t a O n 
 
 	 S l o t   S l o t _ L e d R   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d G   =   0 
 
 	 S l o t   S l o t _ L e d B   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   Y e l l o w O n 
 
 	 S l o t   S l o t _ L e d R   =   9 0 0 
 
 	 S l o t   S l o t _ L e d G   =   4 0 0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   G r e e n O n 
 
 	 S l o t   S l o t _ L e d R   =   0 
 
 	 S l o t   S l o t _ L e d G   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   B l u e O n 
 
 	 S l o t   S l o t _ L e d R   =   0 
 
 	 S l o t   S l o t _ L e d G   =   0 
 
 	 S l o t   S l o t _ L e d B   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   W h i t e O n 
 
 	 S l o t   S l o t _ L e d R   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d G   =   1 0 0 0 
 
 	 S l o t   S l o t _ L e d B   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   R g b O f f 
 
 	 S l o t   S l o t _ L e d R   =   0 
 
 	 S l o t   S l o t _ L e d G   =   0 
 
 	 S l o t   S l o t _ L e d B   =   0 
 
 R e t u r n 
 
 
 
 ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     M O T O R   P O S I T I O N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   Z e r o _ D e g r e e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 S l o t   S l o t _ M o t o r X   =   0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   9 0 _ D e g r e e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 S l o t   S l o t _ M o t o r X   =   9 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   1 8 0 _ D e g r e e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 S l o t   S l o t _ M o t o r X   =   1 8 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   2 7 0 _ D e g r e e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 S l o t   S l o t _ M o t o r X   =   2 7 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   3 6 0 _ D e g r e e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 S l o t   S l o t _ M o t o r X   =   3 6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   a l l   m o t o r s   a r e   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 V a r i a b l e   N u m e r i c   W M 1 
 
 	 F o r   W M 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t _ M o t o r X   +   1 ) )   <   0 . 0 1 
 
 	 	 	 I f   A b s ( S l o t ( S l o t _ M o t o r Y   +   1 ) )   <   0 . 0 1 
 
 	 	 	 	 E x i t 
 
 	 	 	 E n d I f 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     J O G   w i t h   k e y b o a r d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E x e c K e y s 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 V a r i a b l e   N u m e r i c   J o g S p e e d 
 
 	 J o g S p e e d   =   K e y J o g _ S p e e d   /   1 0 0 
 
 	 S e l e c t   T r u e 
 
 	 	 C a s e   K e y ( " S H I F T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 1 
 
 	 	 C a s e   K e y ( " C T R L " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 0 1 
 
 	 	 C a s e   K e y ( " A L T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 0 0 1 
 
 	 E n d S e l e c t 
 
 	 
 
 	 I f   K e y ( " L e f t " ) 
 
 	 	 S l o t ( S l o t _ M o t o r X )   =   L i m i t ( S l o t ( S l o t _ M o t o r X )   +   J o g S p e e d ,   X m i n ,   X m a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " R i g h t " ) 
 
 	 	 S l o t ( S l o t _ M o t o r X )   =   L i m i t ( S l o t ( S l o t _ M o t o r X )   -   J o g S p e e d ,   X m i n ,   X m a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " U p " ) 
 
 	 	 S l o t ( S l o t _ M o t o r Y )   =   L i m i t ( S l o t ( S l o t _ M o t o r Y )   +   J o g S p e e d ,   Y m i n ,   Y m a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " D o w n " ) 
 
 	 	 S l o t ( S l o t _ M o t o r Y )   =   L i m i t ( S l o t ( S l o t _ M o t o r Y )   -   J o g S p e e d ,   Y m i n ,   Y m a x ) 
 
 	 E n d I f 
 
 	 
 
 	 I f   K e y ( " S p a c e " ) 
 
 	 	 G o s u b   D i s a b l e M o t o r s 
 
 	 E n d I f 
 
 	 G o s u b   P r i n t V a l u e s 
 
 	 G o s u b   U p d a t e B u t t o n s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     P R I N T   C O O R D I N A T E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   P r i n t V a l u e s 
 
 ' 	 C o n t r o l s   O p e n T e x t B o x 
 
 ' 	 s 1   =   "   D e s t X = "   +   F o r m a t ( S l o t ( S l o t _ M o t o r X ) ,   " 0 . 0 0 0 " ) 
 
 ' 	 s 1   =   s 1   +   "   D e s t y = "   +   F o r m a t ( S l o t ( S l o t _ M o t o r Y ) ,   " 0 . 0 0 0 " ) 
 
 ' 	 P r i n t   C R L F   +   s 1 
 
 R e t u r n 
 
 
 
 L a b e l   U p d a t e B u t t o n s 
 
 	 B u t t o n   B t n C o o r d X   T e x t   " X   = "   +   F o r m a t ( S l o t ( S l o t _ M o t o r X ) ,   " 0 . 0 0 0 " ) 
 
 	 B u t t o n   B t n C o o r d y   T e x t   " Y   = "   +   F o r m a t ( S l o t ( S l o t _ M o t o r Y ) ,   " 0 . 0 0 0 " ) 
 
 R e t u r n 
 
 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   I n i t S e q u e n c e P a t h s 
 
 	 V a r i a b l e   S t r i n g   E d i t o r F o l d e r 
 
 	 V a r i a b l e   S t r i n g   E d i t o r A p p 
 
 	 V a r i a b l e   S t r i n g   S e q u e n c e P a t h A n d N a m e 
 
 	 V a r i a b l e   S t r i n g   S e q u e n c e N a m e 
 
 	 ' 
 
 	 E d i t o r F o l d e r   =   " . \ T h e r e m i n o _ H A L \ T h e r e m i n o _ E d i t o r \ " 
 
 	 ' 
 
 	 E d i t o r A p p   =   E d i t o r F o l d e r   +   " T h e r e m i n o _ E d i t o r . e x e " 
 
 	 ' 
 
 	 S e q u e n c e P a t h A n d N a m e   =   E d i t o r F o l d e r   +   " S e q u e n c e s \ "   +   S e q u e n c e N a m e 
 
 R e t u r n 
 
 
 
 L a b e l   R u n S e q u e n c e 
 
 	 G o s u b   D i s a b l e A l l B u t t o n s 
 
 	 B u t t o n   E d i t S e q u e n c e   E n a b l e d 
 
 	 B u t t o n   C l o s e A l l   E n a b l e d 
 
 	 G o s u b   I n i t S e q u e n c e P a t h s 
 
 	 B u t t o n   R u n S e q u e n c e   C o l o r   F l a s h i n g 8   Y e l l o w   O r a n g e 
 
 	 S e q u e n c e T o E x e c u t e   =   S e q u e n c e P a t h A n d N a m e 
 
 	 F o r   v 1   =   1   T o   9 e 9 9 
 
 	 	 G o s u b   E x e c S e q u e n c e 
 
 	 N e x t 
 
 	 B u t t o n   R u n S e q u e n c e   C o l o r   Y e l l o w 
 
 R e t u r n 
 
 
 
 L a b e l   E d i t S e q u e n c e 
 
 	 G o s u b   I n i t S e q u e n c e P a t h s 
 
 	 I f   F i l e E x i s t s ( S e q u e n c e P a t h A n d N a m e ) 
 
 	 	 L o a d   E d i t o r A p p   +   "   "   +   S e q u e n c e P a t h A n d N a m e 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   S e l e c t S e q u e n c e 
 
 	 G o s u b   I n i t S e q u e n c e P a t h s 
 
 	 s 1   =   S e l e c t F i l e ( E d i t o r F o l d e r   +   " S e q u e n c e s \ " ) 
 
 	 I f   s 1   < >   " " 
 
 	 	 S e q u e n c e N a m e   =   s 1 
 
 	 	 G o s u b   S h o w S e q u e n c e N a m e 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   S h o w S e q u e n c e N a m e 
 
 	 B u t t o n   S e l e c t S e q u e n c e   T e x t   " S e q u e n c e "   +   C R L F   +   S e q u e n c e N a m e 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E   L O A D I N G   A N D   E X E C U T I O N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   S t r i n g     S e q u e n c e T o E x e c u t e 
 
 V a r i a b l e   S t r i n g     S e q u e n c e 
 
 V a r i a b l e   S t r i n g     S e q u e n c e C m d 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e I n d e x 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e L e n g t h 
 
 
 
 L a b e l   E x e c S e q u e n c e 
 
 	 L o a d   S e q u e n c e   S e q u e n c e T o E x e c u t e 
 
 	 I f   L e n ( S e q u e n c e )   =   0 
 
 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 P r i n t   C R L F   +   "   S e q u e n c e   f i l e   n o t   f o u n d :   "   +   S e q u e n c e T o E x e c u t e 
 
 	 	 B e e p 
 
 	 	 S t o p 
 
 	 E n d I f 
 
 	 ' 
 
 	 P r i n t   C R L F   +   " S e q u e n c e   "   +   G e t F i l e N a m e W i t h o u t P a t h ( S e q u e n c e T o E x e c u t e ) 
 
 	 P r i n t   "   s t a r t e d   a t   "   +   F o r m a t ( N o w ,   " H H : m m : s s " )   +   C R L F   +   C h a r s ( " - " ,   6 5 )   +   C R L F 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 V a r i a b l e   N u m e r i c   E x e c S e q u e n c e S t a r t T i m e 
 
 	 E x e c S e q u e n c e S t a r t T i m e   =   E l a p s e d T i m e 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 S e q u e n c e L e n g t h   =   G e t S e p a r a t e d S t r i n g C o u n t ( S e q u e n c e ,   C R L F ) 
 
 	 F o r   S e q u e n c e I n d e x   =   0   T o   S e q u e n c e L e n g t h   -   1 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 S e q u e n c e C m d   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e ,   S e q u e n c e I n d e x ,   C R L F ) 
 
 	 	 S e q u e n c e C m d   =   R e p l a c e ( S e q u e n c e C m d ,   C h r ( 9 ) ,   "   " )   ' T A B S   t o   S P A C E S 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   D o   n o t   p r i n t   l i n e s   c o n t a i n i n g   ' ' 
 
 	 	 I f   G e t S e p a r a t e d S t r i n g C o u n t ( S e q u e n c e C m d ,   " ' ' " )   <   2 
 
 	 	 	 P r i n t   "   E x e c :   "   +   S e q u e n c e C m d   +   C R L F 
 
 	 	 E n d I f 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   T r i m   a n d   r e m o v e   c o m m e n t s 
 
 	 	 S e q u e n c e C m d   =   T r i m ( R e m o v e C o m m e n t s ( S e q u e n c e C m d ) ) 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 I f   S e q u e n c e C m d   < >   " " 
 
 	 	 	 S e l e c t   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   0 ) 
 
                         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E n d   s e q u e n c e 
 
 	 	 	 	 C a s e   " E n d S e q " 
 
 	 	 	 	 	 E x i t 
 
 	 	         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   A C T I O N S 
 
 	 	 	 	 C a s e   " W a i t A l l M o t o r s " 
 
 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 C a s e   " C L O S E A L L " 
 
 	 	 	 	 	 G o s u b   C l o s e A l l 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L E D   C O L O R S 
 
 	 	 	 	 C a s e   " R e d O n " 
 
 	 	 	 	 	 G o s u b   R e d O n 
 
 	 	 	 	 C a s e   " M a g e n t a O N " 
 
 	 	 	 	 	 G o s u b   M a g e n t a O n 
 
 	 	 	 	 C a s e   " G r e e n O n " 
 
 	 	 	 	 	 G o s u b   G r e e n O n 
 
 	 	 	 	 C a s e   " B l u e O n " 
 
 	 	 	 	 	 G o s u b   B l u e O n 
 
 	 	 	 	 C a s e   " Y e l l o w O n " 
 
 	 	 	 	 	 G o s u b   Y e l l o w O n 
 
 	 	 	 	 C a s e   " W h i t e O n " 
 
 	 	 	 	 	 G o s u b   W h i t e O n 
 
 	 	 	 	 C a s e   " R g b O f f " 
 
 	 	 	 	 	 G o s u b   R g b O f f 
 
 	                         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   W i t h   p a r a m e t e r s 
 
 	 	 	 	 C a s e   " M o v e M o t o r X " 
 
 	 	 	 	 	 v 1   =     G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 S l o t ( S l o t _ M o t o r X )   =   v 1 
 
 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 C a s e   " M o v e M o t o r Y " 
 
 	 	 	 	 	 v 1   =     G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 S l o t ( S l o t _ M o t o r Y )   =   v 1 
 
 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 C a s e   " P a u s e " 
 
 	 	 	 	 	 W a i t   S e c o n d s   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 C a s e E l s e 
 
 	 	 	 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 	 	 	 P r i n t   C R L F   +   "   U n r e c o g n i z e d   c o m m a n d :   "   +   S e q u e n c e C m d   +   C R L F 
 
 	 	 	 	 	 B e e p 
 
 	 	 	 	 	 S t o p 	 	 	 	 	 	 	 	 ' 
 
 	 	 	 E n d S e l e c t 
 
 	 	 E n d I f 
 
 	 N e x t 
 
 	 P r i n t   C h a r s ( " - " ,   6 3 )   +   C R L F   +   " S e q u e n c e   "   +   G e t F i l e N a m e W i t h o u t P a t h ( S e q u e n c e T o E x e c u t e ) 
 
 	 P r i n t   "   e x e c u t e d   i n   "   +   F o r m a t ( E l a p s e d T i m e   -   E x e c S e q u e n c e S t a r t T i m e ,   " 0 . 0 0 " )   +   "   s e c "   +   C R L F 
 
 R e t u r n 
 
 
 
 
 
 